
package protocol.transactions;

import protocol.XoneProtocol;
import protocol.XoneServiceCode;

import com.netease.http.THttpRequest;

public class UnsubscribeTransaction extends XoneBaseTransaction {

    private int mSourceId;

    public UnsubscribeTransaction(int sourceId) {
        super(TRANSACTION_TYPE_UNSUBSCRIBE);
        mSourceId = sourceId;
    }

    @Override
    public void onTransact() {
        THttpRequest request = XoneProtocol.getInstance().createUnsubscribelRequest(mSourceId);
        sendRequest(request);
    }

    @Override
    protected void onXoneTransactionSuccess(int code, Object obj) {
        notifyMessage(XoneServiceCode.TRANSACTION_SUCCESS, mSourceId);
    }

}
